package com.xycake.service;

import com.xycake.dao.OrderMapper;
import com.xycake.entity.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderService {

    @Autowired
    private OrderMapper orderMapper;


    public List<Order> selectOrder(Integer id){
        return orderMapper.selectOrder(id);
    }

    public void insertOrder(Order order){
        orderMapper.insertOrder(order);
    }

    public List<Order> selectAllById(Integer id) {
        return orderMapper.selectOrder(id);
    }

    public List<Order> selectAllOrder() {
        return orderMapper.selectAllOrder();
    }

    public void updataOrder(String ptime, Integer id) {
        Order order = new Order();
        order.setId(id);
        order.setPtime(ptime);
        orderMapper.updateByPrimaryKeySelective(order);
    }
}
